package com.bjpowernode.boss.convert;

import com.bjpowernode.boss.convert.help.CommonFun;
import com.bjpowernode.boss.dao.entity.PayProduct;
import com.bjpowernode.boss.dao.entity.PayWay;
import com.bjpowernode.boss.mvc.models.vo.payproduct.PayProductVo;
import com.bjpowernode.boss.mvc.models.vo.payway.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * payProduct 转化
 *
 * @author yu
 * @date 2024/7/11 18:13
 */
@Mapper(componentModel = "spring", uses = {CommonFun.class})
public interface PaymentConvert {

    List<PayProductVo> toListPayProductVo(List<PayProduct> payProductList) ;

    @Mappings({
            @Mapping(source = "editTime", target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:SS"),
            @Mapping(source = "status", target = "status", qualifiedByName = "transPublicStatus")
    })
    PayProductVo mapPayProductVo(PayProduct payProduct) ;

    List<PayWayVo> toListPayWayVo(List<PayWay> payWayList) ;

    @Mappings({
            @Mapping(source = "editTime", target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:SS"),
            @Mapping(source = "status", target = "status", qualifiedByName = "transPublicStatus")
    })
    PayWayVo mapPayWayVo(PayWay payWay) ;
}
